home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / ami301c.zip / QKROOT.SM$ / QKROOT.SMM
INI File  |  1993-05-15  |  17KB  |  1,411 lines

  1. [ver]
  2.     4
  3. [sty]
  4.     
  5. [files]
  6. [charset]
  7.     82
  8.     ANSI (Windows, IBM CP 1252)
  9. [revisions]
  10.     0
  11. [prn]
  12.     QMS-PS 810
  13. [port]
  14.     LPT1:
  15. [lang]
  16.     1
  17. [desc]
  18.     Quickly calculate the root of a number.
  19.     
  20.     
  21.     
  22.     
  23.     737494397
  24.     14
  25.     734142332
  26.     215
  27.     6
  28.     0
  29.     0
  30.     0
  31.     0
  32.     
  33.     
  34.     
  35.     
  36.     
  37.     
  38.     1
  39. [fopts]
  40.     0
  41.     1
  42.     0
  43.     0
  44. [lnopts]
  45.     2
  46.     Body Text
  47.     1
  48. [docopts]
  49.     5
  50.     2
  51. [GramStyle]
  52.     
  53. [ParaNum]
  54.     1
  55. [tag]
  56.     Body Text
  57.     2
  58.     [fnt]
  59.         Times New Roman
  60.         240
  61.         0
  62.         49152
  63.     [algn]
  64.         1
  65.         1
  66.         0
  67.         0
  68.         0
  69.     [spc]
  70.         33
  71.         273
  72.         1
  73.         0
  74.         0
  75.         1
  76.         100
  77.     [brk]
  78.         4
  79.     [line]
  80.         8
  81.         0
  82.         1
  83.         0
  84.         1
  85.         1
  86.         1
  87.         10
  88.         10
  89.         1
  90.     [spec]
  91.         0
  92.         2
  93.         
  94.         0
  95.         1
  96.         1
  97.         0
  98.         0
  99.         0
  100.         0
  101.     [nfmt]
  102.         280
  103.         1
  104.         2
  105.         .
  106.         ,
  107.         $
  108.     Body Text
  109.     0
  110.     0
  111. [tag]
  112.     Body Single
  113.     3
  114.     [fnt]
  115.         Times New Roman
  116.         240
  117.         0
  118.         49152
  119.     [algn]
  120.         1
  121.         1
  122.         0
  123.         0
  124.         0
  125.     [spc]
  126.         33
  127.         273
  128.         1
  129.         0
  130.         0
  131.         1
  132.         100
  133.     [brk]
  134.         4
  135.     [line]
  136.         8
  137.         0
  138.         1
  139.         0
  140.         1
  141.         1
  142.         1
  143.         10
  144.         10
  145.         1
  146.     [spec]
  147.         0
  148.         0
  149.         
  150.         0
  151.         1
  152.         1
  153.         0
  154.         0
  155.         0
  156.         0
  157.     [nfmt]
  158.         280
  159.         1
  160.         2
  161.         .
  162.         ,
  163.         $
  164.     Body Single
  165.     0
  166.     0
  167. [tag]
  168.     Bullet
  169.     4
  170.     [fnt]
  171.         Times New Roman
  172.         240
  173.         0
  174.         49152
  175.     [algn]
  176.         1
  177.         1
  178.         0
  179.         288
  180.         288
  181.     [spc]
  182.         33
  183.         273
  184.         1
  185.         0
  186.         0
  187.         1
  188.         100
  189.     [brk]
  190.         4
  191.     [line]
  192.         8
  193.         0
  194.         1
  195.         0
  196.         1
  197.         1
  198.         1
  199.         10
  200.         10
  201.         1
  202.     [spec]
  203.         0
  204.         0
  205.         <*0>
  206.         360
  207.         1
  208.         1
  209.         0
  210.         0
  211.         0
  212.         0
  213.     [nfmt]
  214.         272
  215.         1
  216.         2
  217.         .
  218.         ,
  219.         $
  220.     Bullet
  221.     0
  222.     0
  223. [tag]
  224.     Bullet 1
  225.     5
  226.     [fnt]
  227.         Times New Roman
  228.         240
  229.         0
  230.         49152
  231.     [algn]
  232.         1
  233.         1
  234.         288
  235.         288
  236.         288
  237.     [spc]
  238.         33
  239.         273
  240.         1
  241.         0
  242.         0
  243.         1
  244.         100
  245.     [brk]
  246.         4
  247.     [line]
  248.         8
  249.         0
  250.         1
  251.         0
  252.         1
  253.         1
  254.         1
  255.         10
  256.         10
  257.         1
  258.     [spec]
  259.         0
  260.         0
  261.         <*5>
  262.         0
  263.         1
  264.         1
  265.         0
  266.         0
  267.         0
  268.         0
  269.     [nfmt]
  270.         280
  271.         1
  272.         2
  273.         .
  274.         ,
  275.         $
  276.     Bullet 1
  277.     0
  278.     0
  279. [tag]
  280.     Number List
  281.     6
  282.     [fnt]
  283.         Times New Roman
  284.         240
  285.         0
  286.         49152
  287.     [algn]
  288.         1
  289.         1
  290.         360
  291.         360
  292.         360
  293.     [spc]
  294.         33
  295.         273
  296.         1
  297.         0
  298.         0
  299.         1
  300.         100
  301.     [brk]
  302.         4
  303.     [line]
  304.         8
  305.         0
  306.         1
  307.         0
  308.         1
  309.         1
  310.         1
  311.         10
  312.         10
  313.         1
  314.     [spec]
  315.         0
  316.         0
  317.         <*:>.
  318.         360
  319.         1
  320.         1
  321.         0
  322.         16
  323.         0
  324.         0
  325.     [nfmt]
  326.         272
  327.         1
  328.         2
  329.         .
  330.         ,
  331.         $
  332.     Number List
  333.     0
  334.     0
  335. [tag]
  336.     Subhead
  337.     7
  338.     [fnt]
  339.         Times New Roman
  340.         240
  341.         0
  342.         49155
  343.     [algn]
  344.         1
  345.         1
  346.         0
  347.         0
  348.         0
  349.     [spc]
  350.         33
  351.         273
  352.         1
  353.         72
  354.         72
  355.         1
  356.         100
  357.     [brk]
  358.         68
  359.     [line]
  360.         8
  361.         0
  362.         1
  363.         0
  364.         1
  365.         1
  366.         1
  367.         10
  368.         10
  369.         1
  370.     [spec]
  371.         0
  372.         1
  373.         
  374.         0
  375.         1
  376.         1
  377.         0
  378.         0
  379.         0
  380.         0
  381.     [nfmt]
  382.         272
  383.         1
  384.         2
  385.         .
  386.         ,
  387.         $
  388.     Body Text
  389.     0
  390.     0
  391. [tag]
  392.     Title
  393.     8
  394.     [fnt]
  395.         Arial
  396.         360
  397.         0
  398.         16385
  399.     [algn]
  400.         4
  401.         1
  402.         0
  403.         0
  404.         0
  405.     [spc]
  406.         33
  407.         446
  408.         1
  409.         144
  410.         72
  411.         1
  412.         100
  413.     [brk]
  414.         16
  415.     [line]
  416.         8
  417.         0
  418.         1
  419.         0
  420.         1
  421.         1
  422.         1
  423.         10
  424.         10
  425.         1
  426.     [spec]
  427.         0
  428.         0
  429.         
  430.         0
  431.         1
  432.         1
  433.         0
  434.         0
  435.         0
  436.         0
  437.     [nfmt]
  438.         272
  439.         1
  440.         2
  441.         .
  442.         ,
  443.         $
  444.     Title
  445.     0
  446.     0
  447. [tag]
  448.     Header
  449.     9
  450.     [fnt]
  451.         Times New Roman
  452.         240
  453.         0
  454.         49152
  455.     [algn]
  456.         1
  457.         1
  458.         0
  459.         0
  460.         0
  461.     [spc]
  462.         33
  463.         273
  464.         1
  465.         0
  466.         0
  467.         1
  468.         100
  469.     [brk]
  470.         4
  471.     [line]
  472.         8
  473.         0
  474.         1
  475.         0
  476.         1
  477.         1
  478.         1
  479.         10
  480.         10
  481.         1
  482.     [spec]
  483.         0
  484.         0
  485.         
  486.         0
  487.         1
  488.         1
  489.         0
  490.         0
  491.         0
  492.         0
  493.     [nfmt]
  494.         280
  495.         1
  496.         2
  497.         .
  498.         ,
  499.         $
  500.     Header
  501.     0
  502.     0
  503. [tag]
  504.     Footer
  505.     11
  506.     [fnt]
  507.         Times New Roman
  508.         240
  509.         0
  510.         49152
  511.     [algn]
  512.         1
  513.         1
  514.         0
  515.         0
  516.         0
  517.     [spc]
  518.         33
  519.         273
  520.         1
  521.         0
  522.         0
  523.         1
  524.         100
  525.     [brk]
  526.         4
  527.     [line]
  528.         8
  529.         0
  530.         1
  531.         0
  532.         1
  533.         1
  534.         1
  535.         10
  536.         10
  537.         1
  538.     [spec]
  539.         0
  540.         0
  541.         
  542.         0
  543.         1
  544.         1
  545.         0
  546.         0
  547.         0
  548.         0
  549.     [nfmt]
  550.         280
  551.         1
  552.         2
  553.         .
  554.         ,
  555.         $
  556.     Footer
  557.     0
  558.     0
  559. [lay]
  560.     Standard
  561.     513
  562.     [rght]
  563.         15840
  564.         12240
  565.         1
  566.         576
  567.         720
  568.         1
  569.         1080
  570.         576
  571.         0
  572.         1
  573.         0
  574.         1
  575.         0
  576.         2
  577.         1
  578.         576
  579.         11664
  580.         12
  581.         1
  582.         720
  583.         1
  584.         1440
  585.         1
  586.         2160
  587.         1
  588.         2880
  589.         1
  590.         3600
  591.         1
  592.         4320
  593.         1
  594.         5040
  595.         1
  596.         5760
  597.         1
  598.         6480
  599.         1
  600.         7200
  601.         1
  602.         7920
  603.         1
  604.         8640
  605.     [hrght]
  606.     [lyfrm]
  607.         1
  608.         11200
  609.         0
  610.         0
  611.         12240
  612.         1080
  613.         0
  614.         1
  615.         3
  616.         1 0 0 0 0 0 0
  617.         0
  618.         0
  619.         1
  620.     [frmlay]
  621.         1080
  622.         12240
  623.         1
  624.         1440
  625.         72
  626.         1
  627.         288
  628.         1440
  629.         0
  630.         1
  631.         0
  632.         1
  633.         1
  634.         0
  635.         1
  636.         1440
  637.         10800
  638.         2
  639.         2
  640.         4680
  641.         3
  642.         9360
  643.     [txt]
  644. Peyton McManus
  645.  
  646. Lotus WPD
  647.  
  648. >
  649.     [frght]
  650.     [lyfrm]
  651.         1
  652.         13248
  653.         0
  654.         15120
  655.         12240
  656.         15840
  657.         0
  658.         1
  659.         3
  660.         1 0 0 0 0 0 0
  661.         0
  662.         0
  663.         2
  664.     [frmlay]
  665.         15840
  666.         12240
  667.         1
  668.         1440
  669.         648
  670.         1
  671.         15192
  672.         1440
  673.         0
  674.         1
  675.         0
  676.         1
  677.         1
  678.         0
  679.         1
  680.         1440
  681.         10800
  682.         2
  683.         2
  684.         4680
  685.         3
  686.         9360
  687.     [txt]
  688. >
  689. [elay]
  690. [l1]
  691.     0
  692. [edoc]
  693. <:#284,11088>' Example macro to calculate x raised to the y power
  694.  
  695. <:#284,11088>
  696.  
  697. <:#284,11088>Define    NumDec    2
  698.  
  699. <:#284,11088>
  700.  
  701. <:#284,11088>Declare FontDlg(Action, Hdlg, id)
  702.  
  703. <:#284,11088>Declare CellEngine(Value)
  704.  
  705. <:#284,11088>
  706.  
  707. <:#284,11088>Define    AnswerHolder        8002
  708.  
  709. <:#284,11088>Define    CopyButton        3
  710.  
  711. <:#284,11088>
  712.  
  713. <:#284,11088>Define    Desc        "Enter a base value (a) and the root (b) to which you want it raised."
  714.  
  715. <:#284,11088>
  716.  
  717. Define    EM_SetSel        1025
  718.  
  719.  
  720. @Subhead@<:#284,11088>Function Main()
  721.  
  722. <:#284,11088>Mac = GetRunningMacroFile$()
  723.  
  724. <:#284,11088>FontDlg(1,0,0)
  725.  
  726. <:#284,11088>CellEngine(1)' Start the dll and allocate a global var
  727.  
  728. <:#284,11088>FillEdit(1000,"QKRoot.bmt")
  729.  
  730. <:#284,11088>FillEdit(1002, Desc)
  731.  
  732. <:#284,11088>FillEdit(8001,"2")
  733.  
  734. <:#284,11088>FillEdit(AnswerHolder,"8")
  735.  
  736. <:#284,11088>
  737.  
  738. <:#284,11088>SetDlgCallBack(8000,"{Mac}!CallBack")
  739.  
  740. <:#284,11088>SetDlgCallBack(8001,"{Mac}!CallBack")
  741.  
  742. <:#284,11088>SetDlgCallBack(0,"{Mac}!InitDlg")
  743.  
  744. @Outline3@<:#284,11088>DlgKeyInterrupt(112, "{mac}!DisplayHelp")
  745.  
  746. @Outline3@<:#284,11088>
  747.  
  748. <:#284,11088>Box = DialogBox(".","Power")
  749.  
  750. <:#284,11088>If Box = CopyButton
  751.  
  752. <:#284,11088>    Answer = GetDialogField$(AnswerHolder)
  753.  
  754. <:#284,11088>    ClipBoardWrite(Answer, 1)
  755.  
  756. <:#284,11088>Endif
  757.  
  758. <:#284,11088>
  759.  
  760. <:#284,11088>FontDlg(4,0,0)
  761.  
  762. <:#284,11088>CellEngine(0)    ' Shut down the engine
  763.  
  764. <:#284,11088>
  765.  
  766. <:#284,11088>End Function
  767.  
  768. <:#284,11088>
  769.  
  770. <:#284,11088>
  771.  
  772. @Subhead@<:#284,11088>Function InitDlg(Hdlg, id, value)
  773.  
  774. <:#284,11088>IgnoreKeyBoard(2)
  775.  
  776. <:#284,11088>HourGlass(on)
  777.  
  778. <:#284,11088>For x = 1001 to 1006
  779.  
  780. <:#284,11088>    FontDlg(3, Hdlg, x)
  781.  
  782. <:#284,11088>Next
  783.  
  784. FontDlg(3, Hdlg,8000)        ' these editboxes will use the small font.
  785.  
  786. <:#284,11088>FontDlg(3, Hdlg, 8001)
  787.  
  788. SetDlgItemText(Hdlg, 8000,"64")
  789.  
  790. ' this message selects the first 2 characters in the 8000 editbox
  791.  
  792. AppSendMessage(GetDlgITem(Hdlg, 8000),EM_SetSel,0,131072)
  793.  
  794. HourGlass(off)
  795.  
  796. End Function
  797.  
  798. <:#284,11088>
  799.  
  800. @Subhead@<:#284,11088>Function CallBack(Hdlg, id, value)
  801.  
  802. <:#284,11088>IgnoreKeyBoard(2)
  803.  
  804. <:#284,11088>x = GetDlgItemText(Hdlg, 8000) * 1 
  805.  
  806. <:#284,11088>y = GetDlgItemText(Hdlg, 8001) * 1
  807.  
  808. Answer = CellEngine("@Round(({x})^(1/{y}),2)") 
  809.  
  810. 'SetDlgItemText(Hdlg, AnswerHolder, FormatNum$("","",NumDec,Answer))
  811.  
  812. SetDlgItemText(Hdlg, AnswerHolder, Answer)
  813.  
  814.  
  815. End function
  816.  
  817. <:#284,11088>
  818.  
  819. <:#284,11088>
  820.  
  821. @Subhead@<:#284,11088>function DisplayHelp()
  822.  
  823. @Outline2@<:#284,11088>' two defines needed for help.  The help name and panel number are defined above
  824.  
  825. @Outline2@<:#284,11088>define FindWindowa() DllCall("user,FindWindow,HCC", %1, %2)
  826.  
  827. @Outline2@<:#284,11088>define WinHelpa(hWnd, file, cmd, ptr)    DllCall("user,WinHelp,HHCHJ", %1, %2, %3, %4)
  828.  
  829. @Outline2@<:#284,11088>prohWnd = FindWindowa("AmiProWndA", 0)
  830.  
  831. @Outline2@<:#284,11088>helpfile = strcat$(GetAmiDirectory$(), "HelpPack.hlp")
  832.  
  833. @Outline2@<:#284,11088>PanelNum= 80 
  834.  
  835. @Outline2@<:#284,11088>WinHelpa(prohWnd, helpfile, 0x0001, Panelnum)
  836.  
  837. @Outline2@<:#284,11088>end function
  838.  
  839. @Subhead@<:#284,11088>
  840.  
  841. <:#284,11088>
  842.  
  843. <:#284,11088>
  844.  
  845. <:#284,11088>
  846.  
  847. <:p<* >>
  848.  
  849. @Subhead@<:#284,11088>Function FontDlg(Action, Hdlg, id)
  850.  
  851. <:#284,11088>' 1    Create a font and allocvar
  852.  
  853. <:#284,11088>' 2    Return the handle of the create font 
  854.  
  855. <:#284,11088>' 3    Set the id specified to the font
  856.  
  857. <:#284,11088>' 4    Freeglobalvar and delete created object
  858.  
  859. <:#284,11088>
  860.  
  861. @Outline2@<:#568,11088>define    CreateFontDLG()        DllCall("gdi,CreateFont,HHHHHHHHHHHHHHC", %1, %2, %3, %4, %5, %6, %7, %8, %9, %10, %11, %12, %13, %14)
  862.  
  863. @Outline2@<:#284,11088>define    DeleteObjectDLG(handle)    DllCall("gdi,DeleteObject,HH", %1)
  864.  
  865. @Outline2@<:#568,11088>define    SendMessageDLG(hwnd, msg, wpara, lparm)    DllCall("user,SendMessage,HHHHJ", %1, %2, %3, %4)
  866.  
  867. @Outline2@<:#284,11088>
  868.  
  869. @Outline2@<:#284,11088>
  870.  
  871. <:#284,11088>Switch Action
  872.  
  873. <:#284,11088>    Case 1    ' Create the font and store it
  874.  
  875. @Outline2@<:#284,11088>        Font = CreateFontDLG(13, 0, 0, 0, 400, 0, 0, 0, 0, 0, 0, 0, 32, "Helv")
  876.  
  877. <:#284,11088>        AllocGlobalVar("FontHandle",1)
  878.  
  879. <:#284,11088>        If Font
  880.  
  881. <:#284,11088>            SetGlobalVar("FontHandle",Font)
  882.  
  883. <:#284,11088>            Return Font
  884.  
  885. <:#284,11088>        Else
  886.  
  887. <:#284,11088>            Return 0;    ' no font
  888.  
  889. <:#284,11088>        Endif
  890.  
  891. <:#284,11088>        Break;
  892.  
  893. <:#284,11088>    Case 2    ' Return the handle to the font
  894.  
  895. <:#284,11088>        Handle = GetGlobalVar$("FontHandle")
  896.  
  897. <:#284,11088>        If Handle 
  898.  
  899. <:#284,11088>            Return Handle
  900.  
  901. <:#284,11088>        Else
  902.  
  903. <:#284,11088>            Return 0
  904.  
  905. <:#284,11088>        Endif
  906.  
  907. <:#284,11088>
  908.  
  909. <:#284,11088>    Case 3    ' Set the id to the font
  910.  
  911. <:#284,11088>        Handle = GetGlobalVar$("FontHandle")
  912.  
  913. <:#284,11088>        If Handle 
  914.  
  915. <:#284,11088>            IdControl = GetDlgITem(Hdlg, id)
  916.  
  917. <:#284,11088>            SendMessageDlg(idControl, 0x30, Handle, 0)
  918.  
  919. <:#284,11088>            Return 1
  920.  
  921. <:#284,11088>        Else
  922.  
  923. <:#284,11088>            Return 0
  924.  
  925. <:#284,11088>        Endif
  926.  
  927. <:#284,11088>        Break;        
  928.  
  929. <:#284,11088>        
  930.  
  931. <:#284,11088>    Case 4    ' Delete the font and clear the var
  932.  
  933. <:#284,11088>        Handle = GetGlobalVar$("FontHandle")
  934.  
  935. <:#284,11088>        If Handle
  936.  
  937. <:#284,11088>            DeleteObjectDLG(Handle)
  938.  
  939. <:#284,11088>            Stat = 1    
  940.  
  941. <:#284,11088>        Else
  942.  
  943. <:#284,11088>            Stat = 0
  944.  
  945. <:#284,11088>        Endif
  946.  
  947. <:#284,11088>        FreeGlobalVar("FontHandle")
  948.  
  949. <:#284,11088>        Return Stat        
  950.  
  951. <:#284,11088>    Default
  952.  
  953. <:#284,11088>EndSwitch    
  954.  
  955. <:#284,11088>
  956.  
  957. <:#284,11088>End Function
  958.  
  959. @Subhead@<:p<* >>
  960.  
  961. @Subhead@<:#284,11088>Function CellEngine(Action)
  962.  
  963. <:#284,11088>'Available Actions
  964.  
  965. <:#284,11088>'    1         Start the engine and allocate globalvar
  966.  
  967. <:#284,11088>'    2        Return the handle to the instance of the sheet
  968.  
  969. <:#284,11088>'    0        Shut everything down
  970.  
  971. <:#284,11088>'    Default    Expect a formula and return an answer
  972.  
  973. <:#284,11088>
  974.  
  975. <:#284,11088>' these defines may be useful at the beginning of your macro
  976.  
  977. <:#284,11088>Define StartEngine    1
  978.  
  979. <:#284,11088>Define GetInstance    2
  980.  
  981. <:#284,11088>Define CloseEngine    0
  982.  
  983. <:#284,11088>
  984.  
  985. Define    CECREATEINSTANCE(LPHANDLE)    DllCall("LTSCE01.DLL,CECREATEINSTANCE,HO",%1)
  986.  
  987. Define    CEDESTROYINSTANCE(HANDLE)    DllCall("LTSCE01.DLL,CEDESTROYINSTANCE,HH",%1)
  988.  
  989. Define    CECALCNOW(HINSTANCE, lpFormula, lpOutPut)    DllCall("LTSCE01.DLL,CECALCNOW,HHCC",%1,%2,%3)
  990.  
  991. <:#284,11088>
  992.  
  993. <:#284,11088>DefStr hInstance, Answer, Var;
  994.  
  995. <:#284,11088>Mac = GetRunningMacroFile$()
  996.  
  997. <:#284,11088>GlobalInstance = StrCat$(Mac,"hIstance")
  998.  
  999. <:#284,11088>
  1000.  
  1001. <:#284,11088>Switch Action
  1002.  
  1003. <:#284,11088>    Case 1
  1004.  
  1005. <:#284,11088>        ' start the engine
  1006.  
  1007.         LibId = DLLLoadLib("LTSCE01.DLL","CECreateInstance","HO")
  1008.  
  1009. <:#284,11088>        If LibId = 0
  1010.  
  1011.             Message("LTSCE01.DLL not found.  Copy the dll to your windows directory")    
  1012.  
  1013. <:#284,11088>            Return -1;
  1014.  
  1015. <:#284,11088>        Endif
  1016.  
  1017. <:#284,11088>        RetVal = CECREATEINSTANCE(&hInstance)
  1018.  
  1019. <:#284,11088>        AllocGlobalVar("{GlobalInstance}",1)
  1020.  
  1021. <:#284,11088>        AllocGlobalVar("{Mac}LibId",1)
  1022.  
  1023. <:#284,11088>        SetGlobalVar("{Mac}Libid",LibId)
  1024.  
  1025. <:#284,11088>        SetGlobalVar("{GlobalInstance}",hInstance)
  1026.  
  1027. <:#284,11088>        Return hInstance;
  1028.  
  1029. <:#284,11088>        Break;
  1030.  
  1031. <:#284,11088>
  1032.  
  1033. <:#284,11088>    Case 2
  1034.  
  1035. <:#284,11088>        ' return the handle to the instance of the sheet
  1036.  
  1037. <:#284,11088>        AllocGlobalVar("{GlobalInstance}",1)
  1038.  
  1039. <:#284,11088>        hInstance = GetGlobalVar$("{GlobalInstance}")
  1040.  
  1041. <:#284,11088>        Return hInstance;
  1042.  
  1043. <:#284,11088>        Break;
  1044.  
  1045. <:#284,11088>
  1046.  
  1047. <:#284,11088>    Case 0
  1048.  
  1049. <:#284,11088>        ' destroy the instance of the sheet and free the global var and libid
  1050.  
  1051. <:#284,11088>        AllocGlobalVar("{GlobalInstance}",1)
  1052.  
  1053. <:#284,11088>        AllocGlobalVar("{Mac}LibId",1)
  1054.  
  1055. <:#284,11088>        hInstance = GetGlobalVar$("{GlobalInstance}")
  1056.  
  1057. <:#284,11088>        LibId = GetGlobalVar$("{Mac}LibId")
  1058.  
  1059. <:#284,11088>        If hInstance
  1060.  
  1061. <:#284,11088>            CEDestroyInstance(hInstance)
  1062.  
  1063. <:#284,11088>            DllFreeLib(Libid)
  1064.  
  1065. <:#284,11088>        Endif
  1066.  
  1067. <:#284,11088>        FreeGlobalVar("{GlobalInstance}")
  1068.  
  1069. <:#284,11088>        FreeGlobalVar("{Mac}LibId")
  1070.  
  1071. <:#284,11088>        Break;
  1072.  
  1073. <:#284,11088>
  1074.  
  1075. <:#284,11088>    Default
  1076.  
  1077. <:#284,11088>        ' Calculate the formula and return the answer
  1078.  
  1079. <:#284,11088>            AllocGlobalVar("{GlobalInstance}",1)
  1080.  
  1081. <:#284,11088>            hInstance = GetGlobalVar$("{GlobalInstance}")
  1082.  
  1083. <:#284,11088>            CECalcNow(hInstance,"{Action}",&Answer)
  1084.  
  1085. <:#284,11088>            Return Answer;
  1086.  
  1087. <:#284,11088>        Break;
  1088.  
  1089. <:#284,11088>EndSwitch
  1090.  
  1091. <:#284,11088>End Function
  1092.  
  1093. @Subhead@<:#284,11088>
  1094.  
  1095. <:#284,11088>
  1096.  
  1097. <:#284,11088>
  1098.  
  1099. DIALOG    Power
  1100.  
  1101. -2134376448    11    80    33    153    67    ""    "AmiDialog"    "QuickRoot"
  1102.  
  1103. FONT    8    "Helv"
  1104.  
  1105. 76    36    26    12    8000    1350631424    "edit"    ""    0 
  1106.  
  1107. 76    50    26    12    8001    1350631424    "edit"    ""    0 
  1108.  
  1109. 109    3    40    14    1    1342373889    "button"    "Done"    0 
  1110.  
  1111. 109    19    40    14    3    1342373888    "button"    "Copy"    0 
  1112.  
  1113. 3    37    41    23    1000    1342177290    "static"    "filename.bmt"    0 
  1114.  
  1115. 33    38    43    10    1001    1342177280    "static"    "Base value (a):"    0 
  1116.  
  1117. 33    52    43    9    1003    1342177280    "static"    "Root (b):"    0 
  1118.  
  1119. 117    42    27    9    1004    1342177280    "static"    "Answer:"    0 
  1120.  
  1121. 107    51    40    9    8002    1342177281    "static"    ""    0 
  1122.  
  1123. 6    4    83    25    1002    1342177280    "static"    "text"    0 
  1124.  
  1125. 106    36    43    25    20    1342308359    "button"    ""    0 
  1126.  
  1127. END DIALOG
  1128.  
  1129. >
  1130.  
  1131. [Embedded]
  1132. 00013581
  1133. >
  1134. [macsum] 7
  1135. Main 0 0 4 14
  1136. InitDlg 437 3 2 40
  1137. CallBack 736 3 4 54
  1138. DisplayHelp 914 0 4 65
  1139. FontDlg 1099 3 5 79
  1140. CellEngine 1896 1 8 135
  1141. Power 2801 0 -1 204
  1142. [macse]
  1143. 14 Main
  1144. 0 802
  1145. 13
  1146. 8 1
  1147. 16 FontDlg 1 0 0
  1148. 16 CellEngine 1
  1149. 0 31 1000 "QKRoot.bmt"
  1150. 0 31 1002 "Enter a base value (a) and the root (b) to which you want it raised."
  1151. 0 31 8001 "2"
  1152. 0 31 8002 "8"
  1153. 0 41 8000 "{1}!CallBack"
  1154. 0 41 8001 "{1}!CallBack"
  1155. 0 41 0 "{1}!InitDlg"
  1156. 0 47 112 "{1}!DisplayHelp"
  1157. 0 26 "." "Power"
  1158. 13
  1159. 8 2
  1160. 6 2
  1161. 5 3
  1162. 18 0
  1163. 11 00000390
  1164. 0 27 8002
  1165. 13
  1166. 8 3
  1167. 0 1038 "{3}" 1
  1168. 16 FontDlg 4 0 0
  1169. 16 CellEngine 0
  1170. 6 0
  1171. 15
  1172. 9
  1173. 14 InitDlg
  1174. 0 32 2
  1175. 0 296 1
  1176. 5 1001
  1177. 8 4
  1178. 5 1006
  1179. 6 4
  1180. 18 2
  1181. 12 00000120
  1182. 10 00000159
  1183. 5 1
  1184. 6 4
  1185. 3 0
  1186. 8 4
  1187. 10 00000042
  1188. 16 FontDlg 3 "{0}" "{4}"
  1189. 10 00000087
  1190. 16 FontDlg 3 "{0}" 8000
  1191. 16 FontDlg 3 "{0}" 8001
  1192. 0 43 "{0}" 8000 "64"
  1193. 0 44 "{0}" 8000
  1194. 13
  1195. 0 1036 [X] 1025 0 131072
  1196. 0 296 0
  1197. 6 3
  1198. 15
  1199. 9
  1200. 14 CallBack
  1201. 0 32 2
  1202. 0 42 "{0}" 8000
  1203. 13
  1204. 5 1
  1205. 4 0
  1206. 8 4
  1207. 0 42 "{0}" 8001
  1208. 13
  1209. 5 1
  1210. 4 0
  1211. 8 5
  1212. 16 CellEngine "@Round(({4})^(1/{5}),2)"
  1213. 13
  1214. 8 6
  1215. 0 43 "{0}" 8002 "{6}"
  1216. 6 3
  1217. 15
  1218. 9
  1219. 14 DisplayHelp
  1220. 0 284 "user,FindWindow,HCC" "AmiProWndA" 0
  1221. 13
  1222. 8 1
  1223. 0 798
  1224. 13
  1225. 0 16 [X] "HelpPack.hlp"
  1226. 13
  1227. 8 2
  1228. 5 80
  1229. 8 3
  1230. 0 284 "user,WinHelp,HHCHJ" "{1}" "{2}" 1 "{3}"
  1231. 6 0
  1232. 15
  1233. 9
  1234. 14 FontDlg
  1235. 5 1
  1236. 6 0
  1237. 18 0
  1238. 11 00000255
  1239. 0 284 "gdi,CreateFont,HHHHHHHHHHHHHHC" 13 0 0 0 400 0 0 0 0 0 0 0 0 "Helv"
  1240. 13
  1241. 8 4
  1242. 0 271 "FontHandle" 1
  1243. 6 4
  1244. 11 00000217
  1245. 0 264 "FontHandle" "{4}"
  1246. 6 4
  1247. 15
  1248. 9
  1249. 10 00000229
  1250. 5 0
  1251. 15
  1252. 9
  1253. 10 00000785
  1254. 10 00000785
  1255. 5 2
  1256. 6 0
  1257. 18 0
  1258. 11 00000381
  1259. 0 265 "FontHandle"
  1260. 13
  1261. 8 5
  1262. 6 5
  1263. 11 00000356
  1264. 6 5
  1265. 15
  1266. 9
  1267. 10 00000368
  1268. 5 0
  1269. 15
  1270. 9
  1271. 10 00000785
  1272. 5 3
  1273. 6 0
  1274. 18 0
  1275. 11 00000596
  1276. 0 265 "FontHandle"
  1277. 13
  1278. 8 5
  1279. 6 5
  1280. 11 00000558
  1281. 0 44 "{1}" "{2}"
  1282. 13
  1283. 8 6
  1284. 0 284 "user,SendMessage,HHHHJ" "{6}" 48 "{5}" 0
  1285. 5 1
  1286. 15
  1287. 9
  1288. 10 00000570
  1289. 5 0
  1290. 15
  1291. 9
  1292. 10 00000785
  1293. 10 00000785
  1294. 5 4
  1295. 6 0
  1296. 18 0
  1297. 11 00000785
  1298. 0 265 "FontHandle"
  1299. 13
  1300. 8 5
  1301. 6 5
  1302. 11 00000730
  1303. 0 284 "gdi,DeleteObject,HH" "{5}"
  1304. 5 1
  1305. 8 7
  1306. 10 00000740
  1307. 5 0
  1308. 8 7
  1309. 0 266 "FontHandle"
  1310. 6 7
  1311. 15
  1312. 9
  1313. 10 00000785
  1314. 6 3
  1315. 15
  1316. 9
  1317. 14 CellEngine
  1318. 0 802
  1319. 13
  1320. 8 5
  1321. 0 16 "{5}" "hIstance"
  1322. 13
  1323. 8 6
  1324. 5 1
  1325. 6 0
  1326. 18 0
  1327. 11 00000427
  1328. 0 297 "LTSCE01.DLL" "CECreateInstance" "HO"
  1329. 13
  1330. 8 7
  1331. 6 7
  1332. 5 0
  1333. 18 0
  1334. 11 00000258
  1335. 0 3 "LTSCE01.DLL not found.  Copy the dll to your windows directory"
  1336. 5 -1
  1337. 15
  1338. 9
  1339. 0 284 "LTSCE01.DLL,CECREATEINSTANCE,HO" &2
  1340. 13
  1341. 8 8
  1342. 0 271 "{6}" 1
  1343. 0 271 "{5}LibId" 1
  1344. 0 264 "{5}Libid" "{7}"
  1345. 0 264 "{6}" "{2}"
  1346. 6 2
  1347. 15
  1348. 9
  1349. 10 00000893
  1350. 10 00000893
  1351. 5 2
  1352. 6 0
  1353. 18 0
  1354. 11 00000531
  1355. 0 271 "{6}" 1
  1356. 0 265 "{6}"
  1357. 13
  1358. 8 2
  1359. 6 2
  1360. 15
  1361. 9
  1362. 10 00000893
  1363. 10 00000893
  1364. 5 0
  1365. 6 0
  1366. 18 0
  1367. 11 00000780
  1368. 0 271 "{6}" 1
  1369. 0 271 "{5}LibId" 1
  1370. 0 265 "{6}"
  1371. 13
  1372. 8 2
  1373. 0 265 "{5}LibId"
  1374. 13
  1375. 8 7
  1376. 6 2
  1377. 11 00000723
  1378. 0 284 "LTSCE01.DLL,CEDESTROYINSTANCE,HH" "{2}"
  1379. 0 298 "{7}"
  1380. 0 266 "{6}"
  1381. 0 266 "{5}LibId"
  1382. 10 00000893
  1383. 10 00000893
  1384. 0 271 "{6}" 1
  1385. 0 265 "{6}"
  1386. 13
  1387. 8 2
  1388. 0 284 "LTSCE01.DLL,CECALCNOW,HHCC" "{2}" "{0}" &3
  1389. 6 3
  1390. 15
  1391. 9
  1392. 10 00000893
  1393. 6 1
  1394. 15
  1395. 9
  1396. DIALOG Power
  1397. -2134376448 11 80 33 153 67 "" "AmiDialog" "QuickRoot" 
  1398. FONT 8 "Helv" 
  1399. 76 36 26 12 8000 1350631424 "edit" "" 0 
  1400. 76 50 26 12 8001 1350631424 "edit" "" 0 
  1401. 109 3 40 14 1 1342373889 "button" "Done" 0 
  1402. 109 19 40 14 3 1342373888 "button" "Copy" 0 
  1403. 3 37 41 23 1000 1342177290 "static" "filename.bmt" 0 
  1404. 33 38 43 10 1001 1342177280 "static" "Base value (a):" 0 
  1405. 33 52 43 9 1003 1342177280 "static" "Root (b):" 0 
  1406. 117 42 27 9 1004 1342177280 "static" "Answer:" 0 
  1407. 107 51 40 9 8002 1342177281 "static" "" 0 
  1408. 6 4 83 25 1002 1342177280 "static" "text" 0 
  1409. 106 36 43 25 20 1342308359 "button" "" 0 
  1410. 00013606
  1411.